package reflect;


import reflect.annotation.AutoRunClass;
import reflect.annotation.AutoRunMethod;

import java.util.concurrent.LinkedTransferQueue;

@AutoRunClass(6)
public class Person {

    private String name="张三";
    private int age=18;


    //定义sayHello方法
    @AutoRunMethod( value= 30)
    public void sayHello(){
        System.out.println(name+"hello");
    }
    //
    @AutoRunMethod( value=-100)
    public void sayHi(){
        System.out.println(name+"hi");
    }


    public void say(String msg){
        System.out.println(name+":"+msg);
    }
    public void say( String msg, int num){
        for (int i=0;i<num;i++){
            System.out.println(name+":"+msg);
        }
    }
    //dosome
    @AutoRunMethod
    public void doSome(){
        System.out.println(name+"做什么事情");
    }
    //sleep
    public void sleep(){
        System.out.println(name+"在睡觉");
    }
    //watchTv
    public void watchTv(){
        System.out.println(name+"在看电视");
    }
    //playGame
    public void playGame(){
        System.out.println(name+"在玩游戏");
    }
    //sing
    public void sing(){
        System.out.println(name+"在唱歌");
    }
    //study
    public void study(){
        System.out.println(name+"在学习");
    }

    private void  hehe(){
        System.out.println("我是Person的私有方法hehe!!");
    }









    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public Person() {
    }


    public Person( String name) {
        this.name = name;
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }
}
